#ifndef PPL_IP
#define PPL_IP

#include <stdint.h>
#include <stdio.h>
#include <arpa/inet.h>
#include "Packet.h"

#pragma pack (1)
typedef struct _IP_Header
{
	uint8_t version_headerLength;		//version(4 bits) + header length(4 bits)
	uint8_t tos;
	uint16_t totalLength;		//length from header to pkt tail
	uint16_t identification;
	uint16_t flags_fragmentOffset;		//flags(3 bits) + fragment offset(13 bits)
	uint8_t ttl;
	uint8_t protocol;
	uint16_t crc;		//header checksum
	uint32_t srcIP;
	uint32_t dstIP;
} IP_Header;
#pragma pack ()

class IP
{
	public:
		IP();
		int parse(Packet* pkt);
};

#endif
